


<div class="heading-buttons">
	<h3 class="glyphicons briefcase">
		<i></i> Lawyer Listing Management
	</h3>



</div>
<div class="separator"></div>




<div class="widget widget-2 widget-body-white finances_summary">
	<div class="widget-head">
		<h4 class="heading glyphicons briefcase">
			<i></i> Lawyer Listing
		</h4>

		<span class="pull-right"> <a
			href="<?= base_url()?>secure/listing/listings/add"> <span
				class="btn btn-inverse margin-right"> Add New Listing</span>
		</a>
		</span>
	</div>
	<div class="widget-body">
		<div class="row-fluid">


			<fieldset>


				

				<div class="separator bottom">
					<div class="pull-right  margin-bottom">

						<form name="action" method="POST"
							action="<?=base_url(); ?>secure/listing/listings">
							<input class="span6" type="text" name="search"
								margin-bottom="0px"> <select class="span6" name="filter"
								onchange="this.form.submit()">
								<option value="">-- Select --</option>
								<option value="search">Search</option>
								<option value="inactive">Inactive</option>
								<option value="active">Active</option>
							
							</select>
						</form>

					</div>
				</div>

				<table class="table table-bordered table-striped" cellspacing='0'
					width="100%">
					<!-- Table Header -->
					<thead>
						<tr>
							<th width="10%">ID</th>
							<th width="50%">LISTING NAME</th>
							<th width="10%">IMAGE</th>
							<th width="10%">STATUS</th>
							<th width="30%">ACTION</th>
						</tr>
					</thead>
					<!-- Table Header -->
					<!-- Table Body -->
					<tbody>
						<?php if($listing['all']){?>
						<?php foreach ($listing['all'] as $listing) : ?>
						<tr>
							<td><?= $listing->id; ?></td>
							<td><?= $listing->name; ?></td>
							<td align="center"><img width="80" src="<?= base_url();?>assets/images/data/logo/<?= $listing->image;?>"></td>
							<?php if($listing->status ==51){?>
								<td align="center">
								<i class="glyphicons no-js thumbs_up"><i></i></i></td>
							<?php }else{?>
								<td align="center"><i class="glyphicons no-js thumbs_down"><i></i></i></td>
							<?php }?>
							<td align="right">
							
							
							<div class="btn-group">
				                <button class="btn btn-inverse dropdown-toggle" data-toggle="dropdown">Click To Modifie<span class="caret"></span></button>
				                <ul class="dropdown-menu">
				                 
				                  <li><a href="<?= base_url(); ?>secure/listing/listings/change_business_status/<?= $listing->status;?>/<?= $listing->id; ?>" <?php if($this->config->item('mode')=='DEMO'){?>onclick="alert ('Sorry! Demo mode '); return false;" <?} else?>onclick="return confirm('Are you sure ?');"  ><i class="icon-thumbs-up"></i> Make Active</a></li>
				                  <li><a href="<?= base_url(); ?>secure/listing/listings/change_business_status/<?= $listing->status;?>/<?= $listing->id; ?>" <?php if($this->config->item('mode')=='DEMO'){?>onclick="alert ('Sorry! Demo mode '); return false;" <?} else?>onclick="return confirm('Are you sure ?');" ><i class="icon-thumbs-down"></i> Make Inactive</a></li>
				                 
				                 <li><a href="<?= base_url();?>secure/listing/listings/add_logo/<?= $listing->id;?>"><i class="icon-camera"></i> Logo</a></li>	
				                 
				                  <li><a href="<?= base_url(); ?>secure/listing/listings/edit/<?= $listing->id;?>" ><i class="icon-edit"></i> Edit</a></li>
				                 <li> 
				                  </li>
				                  <li><a href="<?= base_url(); ?>secure/listing/listings/delete_business/<?= $listing->id;?>" <?php if($this->config->item('mode')=='DEMO'){?>onclick="alert ('Sorry! Demo mode '); return false;" <?} else?>onclick="return confirm('Are you sure ?');" ><i class="icon-minus"></i> Delete</a></li>
				                  
				                </ul>
				            </div>
							
							
							
						<!-- 
								<form name="action" method="POST"
									action="<?=base_url(); ?>secure/listing/listings/action">
									<input type="hidden" name="listing_id"
										value="<?= $listing->id;?>"> <select name="action"
										onchange="this.form.submit()">
										<option value="">-- Action --</option>
										<option value="inactive">Make Inactive</option>
										<option value="active">Make Active</option>
										<option value="edit">Edit</option>

										<option value="delete">Delete</option>

									</select>
								</form>
								 -->
								
								 							</td>
						</tr>
						<!-- Table Row -->
						<?php endforeach; 
} else { echo "No Data found....";}?>
					</tbody>
					<!-- Table Body -->
					
				</table>
<div class="pagination pull-right">
		<ul>
			<li><?php  echo $this->pagination->create_links(); ?>
			</li>
		</ul>
		</div>
			</fieldset>

		</div>

	</div>
</div>


<!-- This function is used to create active or inactive pagination in filter search -->
<!-- active pagination or inactive pagination
function index()
	{
		//-- Default Value --//



		$status=51;
		$featured=false;
		$search = "";

		if($this->input->post('filter')){
			$filter = $this->input->post('filter');

			switch ($filter) {
				case 'active':
					$status = 51;
					break;
				case 'inactive':
					$status = 1;
					break;
				case 'featured':
					$status = 51;
					$featured=true;
					break;
			}
		}

		$offset = 0 + $this->uri->segment(5);
		$config['base_url'] = base_url() . 'secure/listing/listings/index/';
		$total = $this->admin_counter_model->count_all_business('business_master');

		//print "$total";
		//die();

		$perpage = 8;
		$config['per_page'] = $perpage;
		$config['total_rows'] = $total;
		$config['uri_segment'] = '5';

		//$data['news']['all'] = $this->admin_news_model->get_all_news($perpage, $offset);


		if($status==51)
		{
			$data['listing']['all'] = $this->admin_listing_model->get_listings($featured = $featured, $status = $status, $perpage, $offset);

			$this->pagination->initialize($config);
		}else{
				
			$status=1;
			$offset = 0 + $this->uri->segment(5);
			$config['base_url'] = base_url() . 'secure/listing/listings/inactive/';
			$total = $this->admin_counter_model->count_inactive_business($status);
				
			//print "$total";
			//die();
				
			$perpage = 1;
			$config['per_page'] = $perpage;
			$config['total_rows'] = $total;
			$config['uri_segment'] = '5';
				
			$data['listing']['all'] = $this->admin_listing_model->get_inactive_listings($featured = $featured, $status =$status, $perpage, $offset);
				
			$this->pagination->initialize($config);
		}

		if($this->input->post('search')){
			$search = 	trim($this->input->post('search'));
			$data['listing']['all'] = $this->admin_listing_model->search($search = $search);
			//print $search;
		}

		$this->template->title('Welcome', 'Ypage.com')
		->set_partial('nav_bar','layouts/nav_bar')
		->set_partial('side_menu','layouts/side_menu')
		->set_partial('footer','footer/footer')
		->build('listing/report',$data);
	}

	function inactive()
	{
		//-- Default Value --//
		$status=1;
		$featured=false;
		$search = "";

		if($this->input->post('filter')){
			$filter = $this->input->post('filter');

			switch ($filter) {
				case 'active':
					$status = 51;
					break;
				case 'inactive':
					$status = 1;
					break;
				case 'featured':
					$status = 51;
					$featured=true;
					break;
			}
		}

		$status=1;
		$offset = 0 + $this->uri->segment(5);
		$config['base_url'] = base_url() . 'secure/listing/listings/inactive/';
		$total = $this->admin_counter_model->count_inactive_business($status);

		//print "$total";
		//die();

		$perpage = 1;
		$config['per_page'] = $perpage;
		$config['total_rows'] = $total;
		$config['uri_segment'] = '5';

		$data['listing']['all'] = $this->admin_listing_model->get_inactive_listings($featured = $featured, $status =$status, $perpage, $offset);

		$this->pagination->initialize($config);

		if($this->input->post('search')){
			$search = 	trim($this->input->post('search'));
			$data['listing']['all'] = $this->admin_listing_model->search($search = $search);
			//print $search;
		}

		$this->template->title('Welcome', 'Ypage.com')
		->set_partial('nav_bar','layouts/nav_bar')
		->set_partial('side_menu','layouts/side_menu')
		->set_partial('footer','footer/footer')
		->build('listing/report',$data);
	}

 -->










